package com.example.myapplication.apter;

import android.content.Context;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.example.myapplication.Config.TokenBean;
import com.example.myapplication.R;
import com.example.myapplication.ShuJu.LawyerdetailsBean;


import java.util.List;

public class UserevaluationApter extends  RecyclerView.Adapter<UserevaluationApter.Myhot>{
    private Context context;
    private LawyerdetailsBean.DataBean list;


    public UserevaluationApter(Context context,LawyerdetailsBean.DataBean list) {
        this.context = context;
        this.list = list;
    }

    @NonNull
    @Override
    public UserevaluationApter.Myhot onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View inflate = LayoutInflater.from(context).inflate(R.layout.item_userevaluation, null);
        return new UserevaluationApter.Myhot(inflate);
    }

    @Override
    public void onBindViewHolder(@NonNull UserevaluationApter.Myhot holder, int position) {
        Glide.with(context).load(TokenBean.IP+list.getAvatarUrl()).into( holder.img_avatarUrl);
        holder.text_eduInfo.setText(list.getEduInfo());
        holder.text_licenseNo.setText("年限: "+list.getLicenseNo());
        holder.text_workStartAt.setText("工作起始时间:"+list.getWorkStartAt());
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    class Myhot extends RecyclerView.ViewHolder{

        private final ImageView img_avatarUrl;
        private final TextView text_eduInfo;
        private final TextView text_licenseNo;
        private final TextView text_workStartAt;

        public Myhot(@NonNull View itemView) {
            super(itemView);
            img_avatarUrl = itemView.findViewById(R.id.img_avatarUrl);
            text_eduInfo = itemView.findViewById(R.id.text_eduInfo);
            text_licenseNo = itemView.findViewById(R.id.text_licenseNo);
            text_workStartAt = itemView.findViewById(R.id.text_workStartAt);
        }
    }
}

